<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex主轴方向</title>
</head>
<style>
    div {
        /* 给父级添加flex属性 */
        display: flex;
        width: 800px;
        height: 300px;
        background-color: pink;
        /* 默认的主轴是 x 轴 行row  y轴就是侧轴 */
        /* 我们的元素是跟着主轴来排列的 */
        flex-direction: row;
        /* 可以把主轴设置为y轴   x轴则成为侧轴*/
        /* flex-direction:    ; */
        /* 子元素居中对齐 */
        justify-content: center;
        /* 需要侧轴居中 */
        align-items: center;

    }
    div span {
        width: 150px;
        height: 100px;
        background-color: purple;
        color: aliceblue;
        margin: 10px;
    }
</style>
<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
    </div>
</body>
</html>